package com.duoduo.demo.springnoxml.vo;

import org.springframework.beans.BeanUtils;

import com.duoduo.demo.springnoxml.model.HelpKeyword;

/**
 * 帮助关键字VO
 * @author chengesheng@kedacom.com
 * @date 2017年10月23日下午3:14:16
 */
public class HelpKeywordVO {

	/** 分类ID */
	private int id;
	/** 帮助名称 */
	private String name;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Entity 转换为 VO
	 * @param entity
	 * @return
	 */
	public static HelpKeywordVO fromEntity(HelpKeyword entity) {
		HelpKeywordVO vo = new HelpKeywordVO();
		BeanUtils.copyProperties(entity, vo);
		return vo;
	}

	/**
	 * VO 转换为 Entity
	 * @param entity
	 * @return
	 */
	public static HelpKeyword toEntity(HelpKeywordVO vo) {
		HelpKeyword entity = new HelpKeyword();
		BeanUtils.copyProperties(vo, entity);
		return entity;
	}
}
